3.118 \(\int \frac{c+d x^2+e x^4+f x^6}{x^2 (a+b x^2)} \, dx\)

Optimal. Leaf size=84 \[ -\frac{\tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right ) \left (a^2 b e+a^3 (-f)-a b^2 d+b^3 c\right )}{a^{3/2} b^{5/2}}+\frac{x (b e-a f)}{b^2}-\frac{c}{a x}+\frac{f x^3}{3 b} \]

[Out]

-(c/(a*x)) + ((b*e - a*f)*x)/b^2 + (f*x^3)/(3*b) - ((b^3*c - a*b^2*d + a^2*b*e - a^3*f)*ArcTan[(Sqrt[b]*x)/Sqr
t[a]])/(a^(3/2)*b^(5/2))

________________________________________________________________________________________

Rubi [A]  time = 0.0940384, antiderivative size = 84, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.067, Rules used = {1802, 205} \[ -\frac{\tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right ) \left (a^2 b e+a^3 (-f)-a b^2 d+b^3 c\right )}{a^{3/2} b^{5/2}}+\frac{x (b e-a f)}{b^2}-\frac{c}{a x}+\frac{f x^3}{3 b} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*x^2 + e*x^4 + f*x^6)/(x^2*(a + b*x^2)),x]

[Out]

-(c/(a*x)) + ((b*e - a*f)*x)/b^2 + (f*x^3)/(3*b) - ((b^3*c - a*b^2*d + a^2*b*e - a^3*f)*ArcTan[(Sqrt[b]*x)/Sqr
t[a]])/(a^(3/2)*b^(5/2))

Rule 1802

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{c+d x^2+e x^4+f x^6}{x^2 \left (a+b x^2\right )} \, dx &=\int \left (\frac{b e-a f}{b^2}+\frac{c}{a x^2}+\frac{f x^2}{b}+\frac{-b^3 c+a b^2 d-a^2 b e+a^3 f}{a b^2 \left (a+b x^2\right )}\right ) \, dx\\ &=-\frac{c}{a x}+\frac{(b e-a f) x}{b^2}+\frac{f x^3}{3 b}+\frac{\left (-b^3 c+a b^2 d-a^2 b e+a^3 f\right ) \int \frac{1}{a+b x^2} \, dx}{a b^2}\\ &=-\frac{c}{a x}+\frac{(b e-a f) x}{b^2}+\frac{f x^3}{3 b}-\frac{\left (b^3 c-a b^2 d+a^2 b e-a^3 f\right ) \tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right )}{a^{3/2} b^{5/2}}\\ \end{align*}

Mathematica [A]  time = 0.0633793, size = 83, normalized size = 0.99 \[ \frac{\tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right ) \left (-a^2 b e+a^3 f+a b^2 d-b^3 c\right )}{a^{3/2} b^{5/2}}+\frac{x (b e-a f)}{b^2}-\frac{c}{a x}+\frac{f x^3}{3 b} \]

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x^2 + e*x^4 + f*x^6)/(x^2*(a + b*x^2)),x]

[Out]

-(c/(a*x)) + ((b*e - a*f)*x)/b^2 + (f*x^3)/(3*b) + ((-(b^3*c) + a*b^2*d - a^2*b*e + a^3*f)*ArcTan[(Sqrt[b]*x)/
Sqrt[a]])/(a^(3/2)*b^(5/2))

________________________________________________________________________________________

Maple [A]  time = 0.005, size = 114, normalized size = 1.4 \begin{align*}{\frac{f{x}^{3}}{3\,b}}-{\frac{afx}{{b}^{2}}}+{\frac{ex}{b}}-{\frac{c}{ax}}+{\frac{{a}^{2}f}{{b}^{2}}\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}-{\frac{ae}{b}\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}+{d\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}-{\frac{bc}{a}\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x^6+e*x^4+d*x^2+c)/x^2/(b*x^2+a),x)

[Out]

1/3*f*x^3/b-1/b^2*a*f*x+1/b*x*e-c/a/x+a^2/b^2/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))*f-a/b/(a*b)^(1/2)*arctan(b*x
/(a*b)^(1/2))*e+1/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))*d-1/a*b/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))*c

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^6+e*x^4+d*x^2+c)/x^2/(b*x^2+a),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.5066, size = 444, normalized size = 5.29 \begin{align*} \left [\frac{2 \, a^{2} b^{2} f x^{4} - 6 \, a b^{3} c + 3 \,{\left (b^{3} c - a b^{2} d + a^{2} b e - a^{3} f\right )} \sqrt{-a b} x \log \left (\frac{b x^{2} - 2 \, \sqrt{-a b} x - a}{b x^{2} + a}\right ) + 6 \,{\left (a^{2} b^{2} e - a^{3} b f\right )} x^{2}}{6 \, a^{2} b^{3} x}, \frac{a^{2} b^{2} f x^{4} - 3 \, a b^{3} c - 3 \,{\left (b^{3} c - a b^{2} d + a^{2} b e - a^{3} f\right )} \sqrt{a b} x \arctan \left (\frac{\sqrt{a b} x}{a}\right ) + 3 \,{\left (a^{2} b^{2} e - a^{3} b f\right )} x^{2}}{3 \, a^{2} b^{3} x}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^6+e*x^4+d*x^2+c)/x^2/(b*x^2+a),x, algorithm="fricas")

[Out]

[1/6*(2*a^2*b^2*f*x^4 - 6*a*b^3*c + 3*(b^3*c - a*b^2*d + a^2*b*e - a^3*f)*sqrt(-a*b)*x*log((b*x^2 - 2*sqrt(-a*
b)*x - a)/(b*x^2 + a)) + 6*(a^2*b^2*e - a^3*b*f)*x^2)/(a^2*b^3*x), 1/3*(a^2*b^2*f*x^4 - 3*a*b^3*c - 3*(b^3*c -
 a*b^2*d + a^2*b*e - a^3*f)*sqrt(a*b)*x*arctan(sqrt(a*b)*x/a) + 3*(a^2*b^2*e - a^3*b*f)*x^2)/(a^2*b^3*x)]

________________________________________________________________________________________

Sympy [B]  time = 1.30436, size = 150, normalized size = 1.79 \begin{align*} - \frac{\sqrt{- \frac{1}{a^{3} b^{5}}} \left (a^{3} f - a^{2} b e + a b^{2} d - b^{3} c\right ) \log{\left (- a^{2} b^{2} \sqrt{- \frac{1}{a^{3} b^{5}}} + x \right )}}{2} + \frac{\sqrt{- \frac{1}{a^{3} b^{5}}} \left (a^{3} f - a^{2} b e + a b^{2} d - b^{3} c\right ) \log{\left (a^{2} b^{2} \sqrt{- \frac{1}{a^{3} b^{5}}} + x \right )}}{2} + \frac{f x^{3}}{3 b} - \frac{x \left (a f - b e\right )}{b^{2}} - \frac{c}{a x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x**6+e*x**4+d*x**2+c)/x**2/(b*x**2+a),x)

[Out]

-sqrt(-1/(a**3*b**5))*(a**3*f - a**2*b*e + a*b**2*d - b**3*c)*log(-a**2*b**2*sqrt(-1/(a**3*b**5)) + x)/2 + sqr
t(-1/(a**3*b**5))*(a**3*f - a**2*b*e + a*b**2*d - b**3*c)*log(a**2*b**2*sqrt(-1/(a**3*b**5)) + x)/2 + f*x**3/(
3*b) - x*(a*f - b*e)/b**2 - c/(a*x)

________________________________________________________________________________________

Giac [A]  time = 1.1902, size = 116, normalized size = 1.38 \begin{align*} -\frac{c}{a x} - \frac{{\left (b^{3} c - a b^{2} d - a^{3} f + a^{2} b e\right )} \arctan \left (\frac{b x}{\sqrt{a b}}\right )}{\sqrt{a b} a b^{2}} + \frac{b^{2} f x^{3} - 3 \, a b f x + 3 \, b^{2} x e}{3 \, b^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^6+e*x^4+d*x^2+c)/x^2/(b*x^2+a),x, algorithm="giac")

[Out]

-c/(a*x) - (b^3*c - a*b^2*d - a^3*f + a^2*b*e)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*a*b^2) + 1/3*(b^2*f*x^3 - 3*a*
b*f*x + 3*b^2*x*e)/b^3